<template>
    <div class="team-lv3">
        <div class="lv3-team">
            <div class="level-detail" v-for="(item,index) in level3" :key="index">
                <div class="avatar-box">
                    <img :src="item.distributor['image_url']" alt="">
                </div>
                <div class="left-msg">
                    <div class="top">
                        <img src="~assets/icons/vip3.png" alt="">
                        <span>{{item.distributor.nickname}}</span>
                    </div>
                    <div class="bottom">
                        <span>ID: {{item.distributor.id}}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:'team',
    data(){
        return {
            level3:[],
            lv2Id:''
        }
    },
    methods:{
        getLv3Team(){
            let that = this;
            let token = localStorage.getItem('token');
            let id = that.$route.query.lv2Id;
            let loader = that.loading();
            that.$ajax(that, 'get', that.$api.teamLv3+id, null, token, function(res){
                if(res.data['error_code'] == 0){
                    that.level3 = res.data['msg'];
                }else{
                    that.toast(res.data['msg']);
                }
                loader.close();
            })
        }
    },
    mounted(){
        this.$store.state.tab = '三级分销团队';
        this.getLv3Team();
    },
    activated(){
        this.$store.state.tab = '三级分销团队';
        this.getLv3Team();
    }
}
</script>

<style lang='less'>
@rem:100rem;

.team-lv3{
    width: 750/@rem;
    margin-top: 88/@rem;
    .lv3-team{
        width: 100%;
        background: #ffffff;
        margin-top: 20/@rem;
        .level-detail{
            display: flex;
            height: 90/@rem;
            width: 100%;
            align-items: center;
            border-top: 1px solid #e5e5e5;
            .avatar-box{
                width: 60/@rem;
                height: 60/@rem;
                border-radius: 6/@rem;
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-left: 40/@rem;
                img{
                    width: 60/@rem;
                    height: 60/@rem;
                    border-radius: 6/@rem;
                }
            }
            .left-msg{
                text-align: start;
                margin-left: 10/@rem;
                .top{
                    img{
                        width: 30/@rem;
                        height: 30/@rem;
                    }
                    span{
                        font-size: 30/@rem;
                        color: #444444;
                        margin-left: 16/@rem;
                    }
                }
                .bottom{
                    font-size: 24/@rem;
                    color: #999999;
                }
            }
        }
    }
}
</style>
